package
{
	import flash.display.DisplayObjectContainer;
	import flash.display.DisplayObject;
	import com.bumpslide.data.type.RGB;
	import com.bumpslide.ui.Box;
	import flash.display.Sprite;

	/**
	 * @author ahatch
	 */
	public class Box3D extends Sprite
	{
		private var _front:Box;
		private var _back:Box;
		private var _top:Box;
		private var _bottom:Box;
		private var _left:Box;
		private var _right:Box;
		
		private var _bWidth:Number;
		private var _bHeight:Number;
		private var _bDepth:Number;
		
		public function Box3D(bWidth:Number = 64, bHeight:Number = 64, bDepth:Number = 64)
		{
			_bWidth = bWidth;
			_bHeight = bHeight;
			_bDepth = bDepth;
			
			super();
			init();
		}
		
		private function init():void
		{ 			
			var red:uint = 0xFF0000;
			var green:uint = 0x00FF00;
			var blue:uint = 0x0000FF;
			
			_back = new Box(red);
			_left = new Box(blue);
			_right = new Box(blue);
			_bottom = new Box(green)
			_top = new Box(green);
			_front = new Box(red);
			
			addChild(_back);
			addChild(_bottom);
			addChild(_left);
			addChild(_right);
			addChild(_top);
			addChild(_front);
			
			_front.move(0, 0);
			_front.setSize(_bWidth, _bHeight);
			_front.z = 0;
			_front.rotationX = 0;
			_front.rotationY = 0;
			
			_back.move(0, 0);
			_back.setSize(_bWidth, _bHeight);
			_back.z = _bDepth;
			_back.rotationX = 0;
			_back.rotationY = 0;
			
			_top.move(0, 0);
			_top.setSize(_bWidth, _bDepth);
			_top.z = 0;
			_top.rotationX = 90;
			_top.rotationY = 0;

			_bottom.move(0, _bHeight);
			_bottom.setSize(_bWidth, _bDepth);
			_bottom.z = 0;
			_bottom.rotationX = 90;
			_bottom.rotationY = 0;
			
			_left.move(0, 0);
			_left.setSize(_bDepth, _bHeight);
			_left.z = 0;
			_left.rotationX = 0;
			_left.rotationY = -90;
			
			_right.move(_bWidth, 0);
			_right.setSize(_bDepth, _bHeight);
			_right.z = 0;
			_right.rotationX = 0;
			_right.rotationY = -90;
		}
		
		override public function set rotationX(value:Number):void
		{
			
		}
		
		public function get front():DisplayObjectContainer
		{
			return _front;
		}
		
		public function get back():DisplayObjectContainer
		{
			return _back;
		}
		
		public function get top():DisplayObjectContainer
		{
			return _top;
		}
		
		public function get bottom():DisplayObjectContainer
		{
			return _bottom;
		}
		
		public function get left():DisplayObjectContainer
		{
			return _left;
		}
		
		public function get right():DisplayObjectContainer
		{
			return _right;
		}
	}
}
